import java.util.Scanner;

public class DecimalToBinary {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            decimalToBinary2(n);
        }
    }
    public static String decimalToBinary(int n) {
        if (n == 0) {
            return "0";
        }
        StringBuilder sb = new StringBuilder();
        while (n > 0) {
            sb.insert(0, n % 2);
            n = n / 2;
        }

        return sb.toString();
    }
    public static void decimalToBinary2(int n) {
        String sb = decimalToBinary(n);
        int count = 0;
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i) == '1') {
                count++;
            }
        }
        System.out.println(count);
    }
}
